<!doctype html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
</head>
<body>
    <!--header start -->
    {include file="header"}
    <!--header end-->


    <table class="weui-table weui-border-tb" id="cusTable">
        <thead>
            <tr>
                <th  data-field="username" style="border-left:2px solid #fff">姓名</th>
                <th>昵称</th>
                <th>头像</th>
                <th>公司</th>
                <th>职位</th>
                <th>邮箱</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
                {volist name="data" id="vo"}
                    <tr>
                        <td data-field="" id="sub" style="border-left:2px solid #fff">{$vo.username}</td>
                        <td></td>
                        <td><img src="" style="width: 50px"></td>
                        <td>{$vo.company}</td>
                        <th>{$vo.position}</th>
                        <td>{$vo.email}</td>
                        <th>待审核</th>
                        <th>
                            <a href="###"  data-id="{$vo.id}" onclick="audit(this)" audit="{$vo.audit}" suffix="{$vo.email}"><span  title="通过">通过</span></a>

                            <!-- <a href="###"  data-id="{$vo.id}" onclick="audit(this)" audit="{$vo.audit}"><span   title="不通过">不通过</span></a> -->
                        </th>
                    </tr>
                {/volist}

        </tbody>
    </table>

    <div class="pages">{$page}</div>
    <!--footer start -->
    {include file="footer"}
    <!--footer end-->
    <script src="__STATIC__/js/common/jquery.js"></script>
    <script src="__STATIC__/js/parsley.js"></script>
    <script src="__STATIC__/js/zh_cn.js"></script>
    <script>
//      审核
        function audit(_this){
            var uid = $(_this).attr('data-id');
            var audit = $(_this).attr('audit');
            var suffix =  $(_this).attr('suffix');
            $.ajax({
                type:'post',
                url:"{:url('User/audit')}",
                data:{'uid':uid,'audit':audit,'suffix':suffix},
                success:function(data){
                    console.log(data)
                    if(data.code == 1){
                        window.location.reload()
                    }else{
                        alert('修改失败');
                    }

                }
            })
        }

    </script>
</body>
</html>